package com.corpdata.common.api.activemq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
/**
 *  参考
 *  http://www.bubuko.com/infodetail-2505846.html
 *  https://blog.csdn.net/liuchuanhong1/article/details/52326578
 */
@Component
public class Consumer {
	
	protected Logger logger = LoggerFactory.getLogger(getClass());
	
	@JmsListener(destination="queue.mail",containerFactory = "jmsListenerContainerQueue")
	@Async("myTaskAsyncPool")
	public void receiveMsg(String msg){
		logger.info("消费数据："+msg);
	}
}
